#ifndef ENCRYPTFACADE_H
#define ENCRYPTFACADE_H
#include"abstractencryptfacade.h"
#include"ciphermachine.h"
#include"filereader.h"
#include"filewriter.h"
#include<memory>
class EncryptFacade : public AbstractEncryptFacade
{
private:
    shared_ptr<FileReader> reader;
    shared_ptr<FileWriter> writer;
    shared_ptr<CipherMachine> cipher;
public:
    EncryptFacade()
    {
        reader = make_shared<FileReader>();
        cipher = make_shared<CipherMachine>();
        writer = make_shared<FileWriter>();
    }
    void FileEncrypt(const string & fileNameSrc, const string & fileNameDes)
    {
        string plainStr = reader->Read(fileNameSrc);
        string encryptStr = cipher->Encrypt(plainStr);
        writer->Write(encryptStr, fileNameDes);
    }
};
#endif